]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Only handle touch events in wayland
authorAndrea Azzarone <andrea.azzarone@canonical.com>
Mon, 4 Mar 2019 16:14:22 +0000 (16:14 +0000)
committerAndrea Azzarone <azzaronea@gmail.com>
Mon, 4 Mar 2019 16:21:28 +0000 (16:21 +0000)
There are serveral issues around touch passive grab and touch/pointer doubly
handling to use these on X11, so we stick to single-touch/pointer there.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1015
js/ui/dnd.js

index 554e877736333572b72adf52915135887bf034d6..614ea621d435399650680dc42a9c381225e3e317 100644 (file)
@@ -125,6 +125,16 @@ var _Draggable = class _Draggable {
     }
 
     _onTouchEvent(actor, event) {
+        // We only handle touch events here on wayland. On X11
+        // we do get emulated pointer events, which already works
+        // for single-touch cases. Besides, the X11 passive touch grab
+        // set up by Mutter will make us see first the touch events
+        // and later the pointer events, so it will look like two
+        // unrelated series of events, we want to avoid double handling
+        // in these cases.
+        if (!Meta.is_wayland_compositor())
+            return Clutter.EVENT_PROPAGATE;
+
         if (event.type() != Clutter.EventType.TOUCH_BEGIN ||
             !global.display.is_pointer_emulating_sequence(event.get_event_sequence()))
             return Clutter.EVENT_PROPAGATE;